package com.untrance.shop.model;

import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Transient;

import com.google.appengine.api.datastore.Key;

/**
 * @author eugene zadyra
 */
@Entity
public class Category extends MainEntity{
	private String name;
	
	private int level;
	
	@Basic
	private Key parentCategoryKey;
	
	@Transient
	private List<Category> children;
	
	public Category(){
		
	}
	
	public Category(String name, int level, Key parentKey) {
		super();
		this.name = name;
		this.level = level;
		this.parentCategoryKey = parentKey;
	}

	public Category(String name){
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public void setParentCategoryKey(Key parentCategoryKey) {
		this.parentCategoryKey = parentCategoryKey;
	}

	public Key getParentCategoryKey() {
		return parentCategoryKey;
	}

	public void setChildren(List<Category> children) {
		this.children = children;
	}

	public List<Category> getChildren() {
		return children;
	}
	
}
